/**
 * @author Created by qiush on 2017-05-31.
 */

import * as React from 'react';
import {IAttrRendererProps} from './renderers/IAttrRendererProps';
import rendererMap, {IRenderer} from './renderers';

class AttributePaneItem extends React.Component<IAttrRendererProps, undefined> {
  render() {
    const {attribute} = this.props;
    const Renderer: IRenderer = rendererMap[attribute.type];
    if (!Renderer) {
      return null;
    }
    return (
      <Renderer {...this.props} />
    );
  }
}

export default AttributePaneItem;
